/* icintr2.i - COMMON PROGRAM FOR MISC INVENTORY TRANSACTIONS                 */
/* Copyright 1986 QAD Inc. All rights reserved.                               */
/* $Id:: icintr2.i 15200 2012-02-23 20:06:30Z myb                          $: */
/* $Revision: 1.11 $                                                           */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3     LAST MODIFIED: 11/01/95    BY: ais *G0V9*                */
/* REVISION: 7.3     LAST MODIFIED: 12/14/95    BY: ais *G1GB*                */
/* REVISION: 8.5     LAST MODIFIED: 01/03/96    BY: tjs *J09R*                */
/* REVISION: 8.5     LAST MODIFIED: 07/02/96    BY: taf *J0WS*                */
/* REVISION: 8.6E    LAST MODIFIED: 05/20/98    BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E    LAST MODIFIED: 05/25/98    BY: *H1LB* Dana Tunstall      */
/* REVISION: 8.6E    LAST MODIFIED: 10/04/98    BY: *J314* Alfred Tan         */
/* REVISION: 8.6E    LAST MODIFIED: 12/13/99    BY: *L0MM* Vivek Gogte        */
/* REVISION: 9.1     LAST MODIFIED: 08/13/00    BY: *N0KS* Mark Brown         */
/* Revision: 1.9  BY: Jean Miller DATE: 04/06/02 ECO: *P056* */
/* $Revision: 1.11 $ BY: Paul Donnelly (SB) DATE: 06/28/03 ECO: *Q00G* */
/*-Revision end---------------------------------------------------------------*/

/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*!
Input Parameters:
{1}  selection criteria (minimum is "sr_userid = xxxx")
{2}  variable containing transaction type
{3}  variable containing part
{4}  variable containing the unit of measure
{5}  variable containing editing results (true means error found)
{6}  instructions if pt_mstr should be read to supply UM
*/

{5} = no.

release lad_det.

for each sr_wkfl  where sr_wkfl.sr_domain = global_domain and  {1} and sr_qty
<> 0 no-lock:

   if {6} = "use pt_mstr"
   then do:

      find first pt_mstr  where pt_mstr.pt_domain = global_domain and
      pt_mstr.pt_part = {3}
      no-lock no-error.

      if available pt_mstr then
         {4} = pt_mstr.pt_um.
      else
         {4} = "".

   end.

   {us/bbi/gprun.i ""icedit2.p""
      "( {2},
        sr_site,
        sr_loc,
        {3},
        sr_lotser,
        sr_ref,
        sr_qty * trans_conv,
        {4},
        """",
        """",
        output {5})"}

   if {5} then leave.

end.
